package com.session04;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class TestStudent {
    public static void main(String[] args) {
        List<Student> lst = new ArrayList<>();
        lst.add(new Student("张三", 18, 84));
        lst.add(new Student("李四", 22, 70));
        lst.add(new Student("王五", 20, 95));
        lst.add(new Student("赵六", 20, 70));

        //Collections.sort(lst);
        Collections.sort(lst, new StudentComparator());
        for (Student stu : lst) {
            System.out.println(stu);
        }
    }
}
